import request from '../axios'
/**
 * 新增周计划
 */
export function add (startDate, endDate, year, week) {
  const url = '/api/plan/add'
  const data = {
    startDate,
    endDate,
    year,
    week,
    Loading: true
  }
  return request.post(url, data)
}

/**
 * 获取所有计划列表
 */
export function list () {
  const url = '/api/plan/list'
  return request.get(url)
}

export function listByYear (year) {
  const url = `/api/plan/year/${year}`
  return request.get(url)
}

/**
 * 获取周计划以及所有日程
 */
export function get (planId) {
  const url = `/api/plan/${planId}`
  return request.get(url)
}
